package com.passion.context;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.passion.cache.core.Cache;
import com.passion.mq.core.MqSender;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 类描述：中间件上下文
 *
 * @author ZhuYin
 * @since 2024年12月25日
 */
@Component
public class MiddlewareContext {

    public static ObjectMapper objectMapper;
    @Resource
    public void setObjectMapper(ObjectMapper objectMapper) {
        MiddlewareContext.objectMapper = objectMapper;
    }

    public static Cache cache;
    @Resource
    public void setCache(Cache cache) {
        MiddlewareContext.cache = cache;
    }

    public static MqSender mqSender;
    @Resource
    public void setMqProvider(MqSender mqSender) {
        MiddlewareContext.mqSender = mqSender;
    }

}
